﻿// 1.1.5.06. Write a program that enters the coefficients a, b and c of a quadratic equation a*x2 + b*x + c = 0 and 
// calculates and prints its real roots. Note that quadratic equations may have 0, 1 or 2 real roots.

using System;

class QuadraticEquation
{
    static void Main()
    {
        Begin:

        Console.Write("a = ");
        int a = int.Parse(Console.ReadLine());
        Console.Write("b = ");
        int b = int.Parse(Console.ReadLine());
        Console.Write("c = ");
        int c = int.Parse(Console.ReadLine());

        if ((b*b)-(4*a*c) < 0)
        {
            Console.WriteLine("The equation has no roots.");
        }
        else if ((b*b)-(4*a*c) == 0)
        {
            Console.WriteLine("The equation has one root = {0}", (-b)/(2*a));
        }
        else if ((b*b)-(4*a*c) > 0)
        {
            Console.WriteLine("The equation has two roots = {0}, {1}", (-b + Math.Sqrt(b * b - (4 * a * c))) / (2 * a), (-b - Math.Sqrt(b * b - (4 * a * c))) / (2 * a));
        }

        goto Begin;
    }
}